package com.pro.back.controller;

import com.pro.back.bean.Classes;
import com.pro.back.bean.common.ApiRes;
import com.pro.back.service.ClassesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: jingwenjuan
 * @Description:
 * @Date: 2025-04-19
 */
@RestController
@RequestMapping("/classes")
public class ClassesController {

    @Autowired
    private ClassesService classesService;


    @ApiOperation("查询所有的班级信息")
    @GetMapping("selectAll")
    public ApiRes selectAll() {
        return classesService.selectAll();
    }

    @ApiOperation("新增班级")
    @PostMapping("/inserClasses")
    public ApiRes inserClasses(@RequestBody Classes classes) {
        return classesService.inserClasses(classes);
    }

    @ApiOperation("删除班级")
    @GetMapping("/delClasses")
    public ApiRes delClasses(Long id) {
        return classesService.delData(id);
    }

}
